#include <cstdio>

int main( )
{
    int i, p, re, c[ 10000 ], n;
    while ( scanf("%d", &n) != EOF )
    {
        for ( i = 0; i < 10000; i++ )
            c[ i ] = 0;
        for ( i = 0; i < n; i++ )
        {
            scanf("%d", &p);
            c[ p ]++;
            if ( c[ p ] >= ( n + 1 ) / 2 )
                re = p;
        }
        printf("%d\n", re);
    }
    return 0;
}
